package com.common.util.utils;

import android.app.Application;
import android.content.Context;

/**
 * @文件名称：ApplicationManager.java
 * @文件作者：ljb
 * @文件描述：持有Application的引用
 * @版本： 1.0.0
 * @创建时间：2017-12-19 16:27
 * @修改历史：2017-12-19 16:27
 */

public class ApplicationManager {

    private Application application;
    private Context context;

    private static class LazyHolder{
        private static ApplicationManager INSTANCE = new ApplicationManager();
    }

    private ApplicationManager(){}

    public static ApplicationManager getInstance() {
        return LazyHolder.INSTANCE;
    }

    public void init(Application application) {
        this.application = application;
        this.context = application.getApplicationContext();
    }

    public Application getApplication() {
        return application;
    }

    public Context getContext() {
        return context;
    }
}
